# -*- coding: utf-8 -*-
# @Time    : 2019/11/8 14:20
# @Author  : Jinwei
# @File    : parseyaml.py

import yaml
from tools.log import LOG


def open_yaml(path):
    try:
        file = open(r'%s' % path, 'r', encoding='utf-8')
        data = yaml.load(file,Loader=yaml.FullLoader)
        return {'code': 0, 'data': data}
    except Exception as e:
        return {'code': 1, 'data': e}